package com.springcloud.auth.modular.auth.controller;

import com.springcloud.auth.entity.TUserInfo;
import com.springcloud.auth.service.TUserInfoService;
import com.springcloud.commom.api.R;
import org.apache.ibatis.annotations.Insert;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("user")
@Validated
public class UserController {

    @Resource
    private TUserInfoService service;


    /**
     * 注册用户
     *
     * @return
     */
    @PostMapping("register")
    public R register(@Validated(Insert.class) TUserInfo userInfo) {
        return service.register(userInfo);
    }
}
